package com.ruoyi.resume.mapper;

import com.ruoyi.resume.domain.model.resumeProfile.ProjectExperience;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProjectExperienceMapper {

    @Select("SELECT project_name, project_description, role, start_date, end_date " +
            "FROM project_experience WHERE resume_id = #{resumeId}")
    @Results({
            @Result(column = "project_name", property = "projectName"),
            @Result(column = "project_description", property = "description"),
            @Result(column = "role", property = "role"),
            @Result(column = "start_date", property = "startDate"),
            @Result(column = "end_date", property = "endDate")
    })
    List<ProjectExperience> selectByResumeId(@Param("resumeId") int resumeId);

    @Delete("DELETE FROM project_experience WHERE resume_id = #{resumeId}")
    void deleteByResumeId(int resumeId);
}
